import request from '@/utils/request'

export function userList (data) {
  return request({
    url: 'user/list',
    method: 'post',
    data
  })
}

export function newUser (data) {
  return request({
    url: 'user/add',
    method: 'post',
    data
  })
}

export function editUser (id, data) {
  return request({
    url: `user/edit/${id}`,
    method: 'post',
    data
  })
}

export function deleteUser (id) {
  return request({
    url: `user/delete/${id}`,
    method: 'get'
  })
}

export function getUserName (id) {
  return request({
    url: `user/username/${id}`,
    method: 'get'
  })
}
